#pragma once


class CMILMatrix;
class CEdge;

class CEdgeStore
{
public: 
	CEdgeStore();
	XUINT32 AddRef();
	XUINT32 Release();
	XINT32 SubpixelTop();
	XINT32 SubpixelBottom();
	XINT32 SubpixelLeft();
	XINT32 SubpixelRight();
	HRESULT PopulateEdgeStore(const XUINT32 cPoints, const struct XPOINTF * rgpt, const XUINT8 * rgTypes, const CMILMatrix * pMatrix);
	HRESULT PopulateFromGlyphBitmap(struct IPALGlyphBitmap * pBitmap, const CMILMatrix * pMatrix);
	HRESULT AppendClip(const struct XRECTF_WH & rcClip, const CMILMatrix * pMatrix);
	HRESULT Merge(CEdgeStore * pEdgeStoreOther);
	void SetLayerBounds(XUINT32 SubpixelTop, XUINT32 SubpixelBottom, XUINT32 SubpixelLeft, XUINT32 SubpixelRight);
	XUINT32 IsInsideFrame(const CMILMatrix * pMatrix, XUINT32 fPrimaryBuffer, XINT32 width, XINT32 height, XFLOAT locX, XFLOAT locY);
	XINT32 IsTranslation(const CMILMatrix * pMatrix);
	XINT32 IsRectangular();
	void GetBoundingRectangle(struct XRECTF_WH &);
	void GetBoundingRectangleF(struct XRECTF_WH &);
	XINT32 GetDx(XFLOAT tx);
	XINT32 GetDy(XFLOAT ty);
	XUINT32 EdgeCount();
	CEdge * Edges();
	const struct XRECTF_WH * LocalBounds();
	XINT32 ClipCount();
	XUINT32 MemoryUsage();
	XUINT32 IsGlyphBitmap();
	struct IPALGlyphBitmap * GlyphBitmap();
	struct XRECTF_WH * GetBrushClip();
	void SetBrushClip(struct XRECTF_WH * prcBrushClip);
private: 
	XUINT32 m_cRef;
	XINT32 m_cEdges;
	CEdge * m_pEdges;
	struct IPALGlyphBitmap * m_pGlyphBitmap;
	XINT32 m_nSubpixelYTop;
	XINT32 m_nSubpixelYBottom;
	XINT32 m_nSubpixelXLeft;
	XINT32 m_nSubpixelXRight;
	struct XRECTF_WH m_rcLocalBounds;
	struct XRECTF_WH * m_prcBrushClip;
	XINT32 m_DX;
	XINT32 m_DY;
	XFLOAT m_SX;
	XFLOAT m_SY;
	XINT32 m_clipCount;
	~CEdgeStore();

};